package com.tom.architect02.zframework.hook.hook2;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;

import com.tom.architect02.R;
import com.tom.architect02.p4.day35.MainActivity;

// 监听生命周期。

public class MainHookActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_hook);
    }

    public void JumpPage(View view) {
        startActivity(new Intent(this, MainActivity.class));
    }

    public void logout() {
        SharedPreferences sp = getSharedPreferences("david", MODE_PRIVATE);
        sp.edit().putBoolean("login", false).commit();
        // 退出登录操作。
    }

}